package com.example.webfluxdemo;

import com.example.webfluxdemo.service.HttpContextService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

/**
 * Created by victor on 2021/10/20 10:34.
 */
@RestController
@RequestMapping("hc")
public class HttpContextController {
    private final HttpContextService httpContextService;

    public HttpContextController(HttpContextService httpContextService) {
        this.httpContextService = httpContextService;
    }

    @GetMapping("isDebug")
    public Mono<Boolean> isDebug() {
        return HttpContext.isDebug();
    }
    @GetMapping("isDebug2")
    public Mono<Boolean> appendElk(String name) {
        return httpContextService.isDebug();
    }
}
